package Components
{
	import nl.jorisdormans.phantom2D.objects.GameObjectComponent;
	import Components.ScoreDisplay;
	import Particles.ExplosionParticle;
	/**
	 * ...
	 * @author Sebastiaan
	 */
	public class Health extends GameObjectComponent
	{
		public function Health() 
		{
		}
		
		override public function handleMessage(message:String, data:Object = null):int 
		{
			switch(message) {
				case "damage":
					this.gameObject.destroyed = true;
					Sounds.explosionSound.play();
					this.gameObject.sendMessage("Explosion");
					ChopperGame.playing = false;
					ScoreDisplay.scoring = false;
					break;
			}
			return super.handleMessage(message, data);
		}
	}

}